{% extends "layout.html" %}
{% block body %}
{% for post in posts %}
    <div>
    <div class="thumb">
        <img src="{{ post.thumb() }}" height="80px" style="max-width:80px;max-height: 80px;"/>
    </div>
    <div class="abstract" style="margin-left: 90px;">
        <dl>
            <dt><a class="title" href="{{ url_for('show', pid=post.id) }}"><h2>{{ post.title }}</h2></a></dt>
        <dd>
            <small>日期：{{ post.create_time | dateformat }}&nbsp;&nbsp;阅读：{{ post.read_count }}&nbsp;&nbsp;评论：{{ post.comment_count }}
                {% if session.logged_in %}
                    <a href="{{ url_for('del_post', id=post.id)}}">删除</a>
                    <a href="{{ url_for('edit', id=post.id) }}">编辑</a>
                {% endif %}
            </small>
        </dd>
        </dl>
    </div>
    <span class="clearfix"></span>
    </div>
    <p>{{ post.description() }}...</p>
    {% if loop.last %}
    {% else %}
    <hr/>
    {% endif %}
{% else %}
    <li><em>Unbelivable. No posts here so far</em></li>
{% endfor %}
{% endblock %}
